CC=g++
CFLAGS=-c -Wall -fpermissive `sdl2-config --cflags`
LDFLAGS=-lSDL2main -lSDL2 -lGLEW -lGL -lz -lpng
SOURCES=$(wildcard src/*.cpp)
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=simple

all: $(SOURCES) $(EXECUTABLE)

$(EXECUTABLE): $(OBJECTS) ; $(CC) $(OBJECTS) -o $@ $(LDFLAGS)

.cpp.o: ; $(CC) $< -o $@ $(CFLAGS)

clean: ; rm -f $(OBJS) $(EXECUTABLE)

